import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
// import reconsitution from './reconsitution'
// import Layout from '../views/layout'

import { index } from './module/index' // 首页
import { project } from './module/project' // 项目管理
import { files } from './module/files' // 文件中心
import { users } from './module/users' // 用户管理
import { apiword } from './module/apiWord' // 用户管理

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
    {
        path: '/login',
        name: 'login',
        meta: {
            title: '登录',
            icon: ''
        },
        component: () => import('@/views/login/index.vue')
    },
    {
        path: '/',
        name: 'layout',
        component: () => import('@/layout/index.vue'),
        redirect: '/index',
        children: [index, project, files, users, apiword]
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})
// export const editRouter = reconsitution(routes)
export default router
